package com.lzh.financial.params;

import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 分页的参数信息
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageParam {
    /**
     * 总条数
     */
    private int sums;

    /**
     * 总页数
     */
    private int pages;

    /**
     * 当前页
     */
    private int page;

    /**
     * 每页显示数据的条数
     */
    private int page_size;
    /**
     * pagehelper提供的分页数组
     */
    private int[] pageArr;


    public PageParam(PageInfo pageInfo) {
        this.sums = (int) pageInfo.getTotal();
        this.pages = pageInfo.getPages();
        this.page = pageInfo.getPageNum();
        this.page_size = pageInfo.getPageSize();
        this.pageArr=pageInfo.getNavigatepageNums();
    }
}
